import FSMBlackboard from "./FSMBlackboard";
import FSMCondition from "./FSMCondition";

export enum BoolCondition {
    TRUE,
    FALSE,
}

export default class FSMConditionBool extends FSMCondition<Boolean> {
    private _condition: BoolCondition;
    
    constructor(name: string, value: boolean, condition: BoolCondition) {
        super(name, value);
        this._condition = condition;
    }

    public tick(data: FSMBlackboard): boolean {
        super.tick(data);
        switch (this._condition) {
            case BoolCondition.TRUE:
                return this._currValue == true;
            case BoolCondition.FALSE:
                return this._currValue == false;
        }
    }
}
